import { app, BrowserWindow } from 'electron'
import { createWindow } from './window'

let win = null as null | BrowserWindow
export default () => {
  app.whenReady().then(() => {
    if (!win) win = createWindow()
    win.on('closed', () => {
      win = null
    })
  })
}
